home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / 3d / isl_1_4.lzh / ISL.BNF < prev    next >
Text File  |  1993-03-03  |  6KB  |  271 lines

  1. ISL.BNF - Copyright (c) 1993 John T. Grieggs, last modified 02-20-93
  2.  
  3. This file describes the BNF for ISL, the Imagine Staging Language.  BNF is
  4. Backus Naur Form, a formal method for describing the syntax of a language.
  5. It should be fairly clear from the BNF what is allowable and what is not.
  6. This is a non-trivial document - I suggest you use ISL.doc to get an idea
  7. of what ISL is and does and how it works, then play with the destage and
  8. restage programs, and only then attempt to grok the grammar.
  9.  
  10. Before diving into the BNF, here are some things which are not in the BNF
  11. which are true of the ISL grammar.  Feel free to ignore the regular
  12. expressions and references to flex - they are included for the advanced
  13. user and should not be needed to understand the language.
  14.  
  15. 1)  Whitespace is optional.  You may have an entire stage on one line, or
  16.     may start a new line between any two keywords.  
  17.  
  18. 2)  STRING is a token which is bracketed by double quotes.  A legal string
  19.     may contain 0 or more of the characters [A-Za-z0-9\.\/\_\:\-].  Or, in
  20.     English, any upper or lower case letter, any digit, period, forward
  21.     slash, underscore, or colon.
  22.  
  23. 3)  U32 is a token which contains one or more digits.  It may not have
  24.     a decimal point nor a sign.  {DIGIT}+ is the flex pattern used.
  25.  
  26. 4)  FLOAT is a token which contains an optional minus sign, one or more
  27.     digits, a period, and zero or more digits.  \-?{DIGIT}+\.{DIGIT}*
  28.     is the flex pattern used.  Note that while six digits after the decimal
  29.     are always emitted by destage, zero or more are acceptable.  More than
  30.     five will bring you up against the Imagine rounding problems...
  31.  
  32. 5)  I have not attempted to spell out the meaning of each U32, FLOAT, and
  33.     STRING, on the theory that their meanings should be obvious based on
  34.     their position in the grammar.  For example, in camerahdr, defined
  35.     as CAMERA STRING, you have one keyword (CAMERA) and the name (STRING).
  36.     In this case, STRING would be the name of the CAMERA from the first
  37.     column of the Action editor.  A typical value for this clause would
  38.     be CAMERA "CAMERA".
  39.  
  40. 6)  : means definition, | provides alternates.  Eh?  Take the very first
  41.     part of the BNF for an example.  A stage may consist of a stagehdr
  42.     OR a stagehdr followed by a camera followed by globals followed by
  43.     objects.  These, in turn, are defined individually.
  44.  
  45. 7)  Optional clauses contain an empty : clause followed by one or more
  46.     | clauses.  An example would be genlockflag which is either :
  47.     (nothing) or GENLOCK.  The grammar is riddled with these, so make
  48.     sure you get it.  A stage may have zero or more objects, each of which
  49.     may have one or more positions, one or more alignments, etc.
  50.  
  51. Finally, here's the BNF:
  52.  
  53. stage
  54.     : stagehdr
  55.     | stagehdr camera globals objects
  56.  
  57. stagehdr
  58.     : STAGE MAXFRAMES U32
  59.  
  60. camera
  61.     : camerahdr positions alignments sizes
  62.  
  63. camerahdr
  64.     : CAMERA STRING
  65.  
  66. globals
  67.     : globalhdr globalchunks positions alignments sizes
  68.  
  69. globalhdr
  70.     : GLOBALS STRING
  71.  
  72. globalchunks
  73.     :
  74.     | globalchunks globalchunk
  75.  
  76. globalchunk
  77.     : ACTOR frames
  78.       BRUSH STRING U32
  79.       BACKDROP STRING U32
  80.       AMBIENT rgb HORIZON rgb +ZENITH rgb -ZENITH rgb
  81.       FOG btl FOG rgb
  82.       STARFIELD FLOAT TRANSITION U32 SKYBLEND U32 genlockflag
  83.  
  84. objects
  85.     :
  86.     | objects object
  87.  
  88. object
  89.     : objecthdr filechunks positions alignments sizes hinges effects
  90.     | lighthdr litechunks positions alignments sizes hinges
  91.     | axishdr axischunks positions alignments sizes hinges
  92.  
  93. objecthdr
  94.     : OBJECT STRING quickdrawflag
  95.  
  96. lighthdr
  97.     : LIGHT STRING
  98.  
  99. axishdr
  100.     : AXIS STRING quickdrawflag
  101.  
  102. positions
  103.     :
  104.     | positions posnchunk
  105.     | positions pth2chunk
  106.  
  107. posnchunk
  108.     : POSITION frames xyz
  109.  
  110. pth2chunk
  111.     : POSITION frames PATH STRING ACCEL U32 FLOAT DECEL U32 FLOAT
  112.  
  113. alignments
  114.     :
  115.     | alignments algnchunk
  116.     | alignments palnchunk
  117.     | alignments talnchunk
  118.  
  119. algnchunk
  120.     : ALIGN frames xyz
  121.  
  122. palnchunk
  123.     : ALIGN frames PATH yhorizontalflag
  124.  
  125. talnchunk
  126.     : ALIGN frames OBJECT STRING YROTATION FLOAT FLOAT
  127.  
  128. sizes
  129.     :
  130.     | sizes osizchunk
  131.  
  132. osizchunk
  133.     : SIZE frames xyz
  134.  
  135. filechunks
  136.     :
  137.     | filechunks filechunk
  138.  
  139. filechunk
  140.     : ACTOR frames NAME STRING CYCLE FLOAT FLOAT reverseflag TRANSITION U32
  141.  
  142. litechunks
  143.     :
  144.     | litechunks litechunk
  145.  
  146. litechunk
  147.     : ACTOR frames sccshape shadowflag diminishflag rgb TRANSITION U32
  148.  
  149. axischunks
  150.     :
  151.     | axischunks axischunk
  152.  
  153. axischunk
  154.     : ACTOR frames
  155.  
  156. hinges
  157.     :
  158.     | hinges hingchunk
  159.  
  160. hingchunk
  161.     : HINGE frames OBJECT STRING
  162.  
  163. effects
  164.     :
  165.     | effects effect
  166.  
  167. effect
  168.     : EFFECT U32 frames Boing2.0 STRING
  169.       xyzaxis ucdsquash SHRINK FLOAT TIMES U32
  170.     | EFFECT U32 frames Fireworks STRING
  171.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  172.       ROTATIONS FLOAT FLOAT EXPANSION FLOAT DISTANCE FLOAT SEED U32
  173.       sparkleflag
  174.     | EFFECT U32 frames Flash STRING
  175.       ON U32 OFF U32 startflag
  176.     | EFFECT U32 frames Grow STRING
  177.       YROT FLOAT XSCALE FLOAT
  178.       ZSCALE FLOAT XTRANS FLOAT ZTRANS FLOAT
  179.       alignyflag keepxflag mirrorflag reverseflag
  180.     | EFFECT U32 frames Ripple STRING
  181.       lrtoggle WAVELENGTH FLOAT ZAMP FLOAT TRAVEL FLOAT RIPPLES U32
  182.     | EFFECT U32 frames Rotate2.0 STRING
  183.       xyzaxis DEGREES FLOAT
  184.     | EFFECT U32 frames Tumble STRING
  185.       rzaxis ROTATIONS FLOAT FLOAT SEED U32
  186.  
  187. frames
  188.     : FRAMES U32 U32
  189.  
  190. xyz
  191.     : XYZ FLOAT FLOAT FLOAT
  192.  
  193. rgb
  194.     : RGB FLOAT FLOAT FLOAT
  195.  
  196. btl
  197.     : BTL FLOAT FLOAT FLOAT
  198.  
  199. xyzaxis
  200.     : XAXIS
  201.     | YAXIS
  202.     | ZAXIS
  203.  
  204. rzaxis
  205.     : RANDOMAXIS
  206.     | ZAXIS
  207.  
  208. ucdsquash
  209.     : +SQUASH
  210.     | SQUASH
  211.     | -SQUASH
  212.  
  213. srlshape
  214.     : SPHERICAL
  215.     | RADIAL
  216.     | LINEAR
  217.  
  218. sccshape
  219.     : SPHERICAL
  220.     | CYLINDRICAL
  221.     | CONICAL
  222.  
  223. sparkleflag
  224.     :
  225.     | SPARKLE
  226.  
  227. startflag
  228.     : STARTON
  229.     | STARTOFF
  230.  
  231. alignyflag
  232.     :
  233.     | ALIGNY
  234.  
  235. keepxflag
  236.     :
  237.     | KEEPX
  238.  
  239. mirrorflag
  240.     :
  241.     | MIRROR
  242.  
  243. reverseflag
  244.     :
  245.     | REVERSE
  246.  
  247. lrtoggle
  248.     : LINEAR
  249.     | RADIAL
  250.  
  251. shadowflag
  252.     :
  253.     | SHADOW
  254.  
  255. diminishflag
  256.     :
  257.     | DIMINISH
  258.  
  259. genlockflag
  260.     :
  261.     | GENLOCK
  262.  
  263. yhorizontalflag
  264.     :
  265.     | YHORIZONTAL
  266.  
  267. quickdrawflag
  268.     :
  269.     | QUICKDRAW
  270.  
  271.